package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.SystemLog;
import cn.wolfcode.crm.mapper.SystemLogMapper;
import cn.wolfcode.crm.page.PageResult;
import cn.wolfcode.crm.query.SystemLogQueryObject;
import cn.wolfcode.crm.service.ISystemLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemLogServiceImpl implements ISystemLogService {

    @Autowired
    private SystemLogMapper systemLogMapper;

    public PageResult query(SystemLogQueryObject qo) {
        int total = systemLogMapper.queryForCount(qo);

        if (total==0){
            return new PageResult();
        }
        List list = systemLogMapper.queryForList(qo);
        return new PageResult(total,list);
    }


    public void reload() {
        //排除重复
        List<SystemLog> systemLogs = systemLogMapper.selectAll();
    }

    public void remove(Long[] ids) {
        //根据拿到的日志的id来删除该日志
        systemLogMapper.delete(ids);
    }

}
